import request from '@/utils/request'

// 查询应用注册列表
export function listAppinfo(query) {
  return request({
    url: '/system/appinfo/list',
    method: 'get',
    params: query
  })
}

// 查询应用注册详细
export function getAppinfo(appId) {
  return request({
    url: '/system/appinfo/' + appId,
    method: 'get'
  })
}

// 新增应用注册
export function addAppinfo(data) {
  return request({
    url: '/system/appinfo',
    method: 'post',
    data: data
  })
}

// 修改应用注册
export function updateAppinfo(data) {
  return request({
    url: '/system/appinfo',
    method: 'put',
    data: data
  })
}

// 删除应用注册
export function delAppinfo(appId) {
  return request({
    url: '/system/appinfo/' + appId,
    method: 'delete'
  })
}

// 缓存应用注册
export function refreshAppInfo() {
  return request({
    url: '/system/appinfo/refreshAppInfo',
    method: 'post'
  })
}

// 应用状态修改
export function changeAppInfoStatus(appId, appStatus) {
  const data = {
    appId,
    appStatus
  }
  return request({
    url: '/system/appinfo/changeStatus',
    method: 'put',
    data: data
  })
}
